﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data;
namespace Wwtfly.BBS.BackDAL.News
{
  public  class NewsUIDAL
    {
        /// <summary>
        /// 获取首页新闻列表
        /// </summary>
        /// <param name="TypeId">新闻类型ID</param>
        /// <returns></returns>
        public static DataTable NewsList(int top,string TypeId)
        {
            string sql = string.Format("select top ({0}) Id,  Keyword, NewsTitle, NewsTag, CreateUser from pm_newsShows where TypeId={1} and NewsState=0  order by NewsInTime desc", top, TypeId);
            Database db = DatabaseFactory.CreateDatabase();
            DataSet ds = db.ExecuteDataSet(CommandType.Text, sql);

            return ds == null ? null : ds.Tables[0];
        }
    }
}
